home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
-
-
-
- NNNNAAAAMMMMEEEE
- getnetent, getnetent_r, fgetnetent, fgetnetent_r, getnetbyaddr,
- getnetbyaddr_r, getnetbyname, getnetbyname_r, setnetent, endnetent - get
- network entry
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttddddbbbb....hhhh>>>>
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeetttteeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeetttteeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ffffggggeeeettttnnnneeeetttteeeennnntttt((((FFFFIIIILLLLEEEE ****))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ffffggggeeeettttnnnneeeetttteeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyynnnnaaaammmmeeee((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyynnnnaaaammmmeeee____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyyaaaaddddddddrrrr((((lllloooonnnngggg nnnneeeetttt,,,, iiiinnnntttt ttttyyyyppppeeee))));;;;
-
- ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyyaaaaddddddddrrrr____rrrr((((lllloooonnnngggg nnnneeeetttt,,,, iiiinnnntttt ttttyyyyppppeeee,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- vvvvooooiiiidddd sssseeeettttnnnneeeetttteeeennnntttt((((iiiinnnntttt ssssttttaaaayyyyooooppppeeeennnn))));;;;
-
- vvvvooooiiiidddd eeeennnnddddnnnneeeetttteeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _G_e_t_n_e_t_e_n_t, _f_g_e_t_n_e_t_e_n_t, _g_e_t_n_e_t_b_y_n_a_m_e, _g_e_t_n_e_t_b_y_a_d_d_r and each of their
- reentrant counterparts each return a pointer to an object with the
- following structure containing the broken-out fields of a line in the
- network data base file, /_e_t_c/_n_e_t_w_o_r_k_s, or some other back-end networks
- database.
-
- struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net number type */
- unsigned long n_net; /* net number */
- };
-
- The members of this structure are:
-
- n_name The official name of the network.
-
- n_aliases A zero terminated list of alternate names for the network.
-
- n_addrtype The type of the network number returned; currently only
- AF_INET.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
-
-
-
- n_net The network number. Network numbers are returned in machine
- byte order.
-
- _G_e_t_n_e_t_e_n_t reads the next line of the file, opening the file if necessary.
-
- _S_e_t_n_e_t_e_n_t opens and rewinds the file. If the _s_t_a_y_o_p_e_n flag is non-zero,
- the net data base will not be closed after each call to _g_e_t_n_e_t_b_y_n_a_m_e or
- _g_e_t_n_e_t_b_y_a_d_d_r.
-
- _E_n_d_n_e_t_e_n_t closes the file.
-
- _G_e_t_n_e_t_b_y_n_a_m_e and _g_e_t_n_e_t_b_y_a_d_d_r sequentially search from the beginning of
- the file until a matching net name or net address and type is found, or
- until EOF is encountered. Network numbers are supplied in host order.
-
- The routines fgetnetent and fgetnetent_r will return the next line in the
- supplied file parsed into a struct netent structure. The file must be in
- the same format as the /_e_t_c/_n_e_t_w_o_r_k_s file.
-
- The routines getnetent, fgetnetent, getnetbyaddr, and getnetbyname all
- return pointers into static space which is modified on each call.
- Reentrant versions of each routine getnetent_r, fgetnetent_r,
- getnetbyaddr_r and getnetbyname_r. These routines parse the result into
- supplied space. They each take a pointer to a netent structure, a
- pointer to some buffer, and a length for the buffer.
-
- The routines documented in this file only parse files of the format given
- in networks(4). These can be static files on the system such as the
- /_e_t_c/_n_e_t_w_o_r_k_s file, or files supplied dynamically by the nsd(1M) daemon
- from some other backend database such as NIS.
-
- NNNNOOOOTTTTEEEE
- The Mips ABI specifies nothing but local files so applications which wish
- to use anything else must compile with libc prior to libnsl in the
- library list.
-
- When nsd is running changes in the local networks file may not be noticed
- by getnetent() until the enumeration cache file has timed out.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- All functions that return struct netent * will return a null (0) pointer
- in the case of EOF or failure.
-
- FFFFIIIILLLLEEEESSSS
- /etc/networks /var/ns/cache/networks.byname.m
- /var/ns/cache/networks.byaddr.m
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- nsd(1M), networks(4)
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
-
-
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Null pointer (0) returned on EOF or error.
-
- BBBBUUUUGGGGSSSS
- Only Internet network numbers are currently understood.
-
- Expecting network numbers to fit in no more than 32 bits is probably
- naive.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-